<!DOCTYPE html>
<html>
<head>
<#include "/common/freemarker/include_css.ftl">
<title>编辑</title>
</head>
 
<body>
	<div class="panel panel-default">
	   <div class="panel-heading">
	       <div class="panel-title">编辑</div>
	   </div>
	   <div clas="panel-body">
	      <div class="row">
	           <div class="col-md-12">
	               <br>
	               <form id="contentForm" class="form-horizontal"  action="<@context/>ued/tpltb3Uuid/save.do" method="post"  >
	                	<input type="hidden" name="uuid" value='<#if rhs["obj"]?exists>${rhs["obj"].uuid?if_exists}</#if>' />
						<input type="hidden" name="projectId" value='<#if rhs["obj"]?exists>${rhs["obj"].projectId?if_exists}</#if>' />
	                    <div class="form-group">
	                    	<label class="col-md-2 control-label">标题 <font color="red"> *</font></label>
	                        <div class="col-md-9">
								<input type="text"  class="input-sm form-control required" id="title" name="title" value='<#if rhs["obj"]?exists>${rhs["obj"].title?if_exists}</#if>'    minlength="2"  />
	                    	</div>              	
	                    </div> 
	                     <div class="form-group">
	                    	<label class="col-md-2 control-label">完成期限 <font color="red"> *</font></label>
	                        <div class="col-md-9">
	                   			<input type="text" class="input-sm form-control required" id="deadline" name="deadline" value='<#if rhs["obj"]?exists && rhs["obj"].deadline?exists>${rhs["obj"].deadline?string("yyyy-MM-dd HH:mm:ss")}</#if> ' 
								onclick="javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});"   class="{required:true}"/>
						     </div>              	
	                    </div>
	                    <div class="form-group">
	                    	<label class="col-md-2 control-label">附件</label>
	                        <div class="col-md-9">
	                            <#assign tmps="">
	                        	<#if rhs["obj"]?exists>
									<#assign tmps=rhs["obj"].attachment?if_exists>
	                        	</#if>
	                   			 <@attachment  id="attachment" name="attachment" value="${tmps}" namePrefix=""  showType="all" /> 
						     </div>              	
	                    </div>  
	                    <div class="form-group">
	                    	<div class="col-md-offset-2 col-md-10">
	                    		<input type="button" class="btn btn-sm btn-primary" id="submitBtn" value="保 存"/>
	                    		<input type="button" class="btn btn-sm btn-default" value="返 回" onclick="javascript:history.go(-1)"/>
	                    	</div>
	                    </div>
	              </form>
	        </div>
	    </div>
	</div>
	<#--  公共js -->
	<#include "/common/freemarker/include_js.ftl">
	<#--  页面自己的js -->
	
	<script>
		$(document).ready(function() {
				var form = $('#contentForm');
		  		form.validate({
					rules: {
		    			"bfobject.startTime":{
			    			required: true,
		    			}
					}
			
			    });
		});
		
		
		$("#submitBtn").click(function() {
			  if(!$("#contentForm").valid()){
			    	 return;
			  }
			  /**
			  var  school= $('input[name="school"]:checked').val();
			  if (typeof(school) == "undefined" || school=="" ){
			      alert("请选择学校");
			      return;
			   }else{
			       $('input[name="bfobject.school"]').val(school);
			   }
			   
			  $('input[name="bfobject.school"]').val(school);
			  **/
			  $("#submitBtn").attr("value", "提交中..."); 
			  $('#contentForm').find(":button").attr("disabled", true);
			  $("#contentForm").submit(); //提交表单，如果不写，即便通过表单也不会自动提交 
		})
		 

	
	</script>
</body>
</html>
 

